package common

import (
	"github.com/jinzhu/gorm"
	"managementsystem/pkg/utils"
)

func UpdateScore(db *gorm.DB, score utils.StudentScore) utils.StudentScore{
	err := db.Table("sc").Where("sno=?",score.Sno).Where("cno=?",score.Cno).Update("score",score.Score).Error
	utils.ErrCheck(err)
	db.Save("sc")

	return score
}
